package com.example.test_20210601_Fruits;

public interface AnimalsFactory {

    Animals createAnimal();
    class Dog implements AnimalsFactory{

        @Override
        public Animals createAnimal() {
            return new AbstractDog();
        }
    }

    class Cat implements AnimalsFactory{

        @Override
        public Animals createAnimal() {
            return new AbstractCat();
        }
    }

}
